<!DOCTYPE html>
<html class="no-js" lang="en">
<head>
    <meta charset="utf-8">
    <title>评价列表界面</title>
    <meta name="description" content="">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!--====== Favicon Icon ======-->
    <link rel="shortcut icon" href="assets/images/favicon.png" type="image/png">
    <!--====== Magnific Popup CSS ======-->
    <link rel="stylesheet" href="assets/css/magnific-popup.css">
    <!--====== Slick CSS ======-->
    <link rel="stylesheet" href="assets/css/slick.css">
    <!--====== Line Icons CSS ======-->
    <link rel="stylesheet" href="assets/css/LineIcons.css">
    <!--====== Bootstrap CSS ======-->
    <link rel="stylesheet" href="assets/css/bootstrap.min.css">
    <!--====== Default CSS ======-->
    <link rel="stylesheet" href="assets/css/default.css">
    <!--====== Style CSS ======-->
    <link rel="stylesheet" href="assets/css/style.css">

</head>
<body>
<!-- 导入页眉 -->
<div class="header"></div>

<!--====== 自定义代码开始 ======-->
<section id="about" class="about-area">
    <div class="container-fluid">

        <div>
            <h3 style="position: absolute;top: 300px;left: 3%;">我的评论</h3>
        </div>

        <!--====== 从这里开始 ======-->
        <div class="row col-md-7 offset-md-2"style="margin-top: 5%;"id="div_vue">
            <table class="table">
                <thead class="thead-dark">
                <tr>
                    <th scope="col">评论序列</th>
                    <th scope="col">评论人</th>
                    <th scope="col">评论时间</th>
                    <th scope="col">评论内容</th>
                    <th scope="col">评论文章</th>
                </tr>
                </thead>
                <tbody>
                <div v-if="commentList==='暂无评论'" style="font-size: 30px">{{commentList}}~~</div>
                <div v-else>
                <tr v-for="comment in commentList">
                    <th scope="row">{{comment.commentId}}</th>
                    <td>{{comment.userName}}</td>
                    <td>{{comment.commentTimeStr}}</td>
                    <td>{{comment.commentContent}}</td>
                    <td>{{comment.articleName}}</td>
                </tr>
                    </div>
                </tbody>
            </table>
        </div>
        <!--====== 导入右边导航栏 ======-->
        <div class="admin-nav"></div>
        <!--====== 从这里结束 ======-->
    </div> <!-- container -->

</section>
<!--====== 自定义代码结束 ======-->


<!-- 导入页脚 -->
<div class="footer"></div>
<!--导入所有js文件-->
<!--====== Jquery js ======-->
<script src="assets/js/vendor/jquery-1.12.4.min.js"></script>
<script src="assets/js/vendor/modernizr-3.7.1.min.js"></script>
<!--====== Bootstrap js ======-->
<script src="assets/js/popper.min.js"></script>
<script src="assets/js/bootstrap.min.js"></script>
<!--====== Slick js ======-->
<script src="assets/js/slick.min.js"></script>
<!--====== Magnific Popup js ======-->
<script src="assets/js/jquery.magnific-popup.min.js"></script>
<!--====== Ajax Contact js ======-->
<script src="assets/js/ajax-contact.js"></script>
<!--====== Isotope js ======-->
<script src="assets/js/imagesloaded.pkgd.min.js"></script>
<script src="assets/js/isotope.pkgd.min.js"></script>
<!--====== Scrolling Nav js ======-->
<script src="assets/js/jquery.easing.min.js"></script>
<script src="assets/js/scrolling-nav.js"></script>
<!--====== Main js ======-->
<script src="assets/js/main.js"></script>
<!--导入vue 包-->
<script src="https://cdn.jsdelivr.net/npm/vue"></script>
<!--导入工具包-->
<script src="assets/js/util/HttpUtil.js"></script>
</body>
</html>
<script type="text/javascript">
    //在js中引入页眉页脚
    $(document).ready(function () {
        $('.header').load('header.html');
        $('.footer').load('footer.html');
        $('.admin-nav').load('admin-nav.html');
    });
    var vm = new Vue({
        el: '#div_vue',
        data: {
            commentList:[]
        },
        methods: {
            refreshCommentList: function () {
                //发起http请求后台获取商家列表数据
                let url = "commentShowInList.do";
                let thisObj = this;
                doGet(url, function (data) {
                    thisObj.commentList = data;
                })
            }
        },
        mounted: function () {
            //页面加载完成，并且vue对象加载完成之后调用
            this.refreshCommentList();
        },
        created: function () {
            console.log("created");
        }
    });
</script>